import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const route = new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      redirect: '/system',
      component: () => import('@/views/index'),
      children: [
        {
          path: '/system',
          name: 'system',
          meta: {
            title: '系统工具'
          },
          component: () => import('@/views/systemTool/index.vue')
        },
        {
          path: '/system/shut-task',
          name: 'systemShutTask',
          component: () => import('@/views/systemTool/shutTask.vue')
        },
        {
          path: '/picture',
          name: 'picture',
          component: () => import('@/views/picture/index.vue')
        },
        {
          path: '/picture/compression',
          name: 'pictureCompression',
          component: () => import('@/views/picture/compression.vue')
        },
        {
          path: '/picture/convertIcon',
          name: 'pictureConvertIcon',
          component: () => import('@/views/picture/convertIcon.vue')
        }
      ]
    },
    {
      path: '*',
      redirect: '/'
    }
  ]
})
route.beforeEach((to, from, next) => {
  next()
})
export default route
